﻿

using System.Collections.Generic;
using System.Text;
using UtilLib;

public static partial class Efun
{
    //经验获取等级
    public static int Exp2Level(long exp)
    {
        int min = ConfDescLevel.Keys.Min();
        int max = ConfDescLevel.Keys.Max();
        int grade = min;
        if (true)
        {
            for (int i = min; i < max; i++)
            {
                if (!ConfDescLevel.TryGetValue(i, out var conf))
                {
                    break;
                }
                if (exp < conf.Exp)
                {
                    break;
                }
                grade = i;
            }
        }
        grade = Math.Min(grade, max);
        return grade;
    }
    //技能升级所需潜能
    public static long GetPotLevelup(int skilllv)
    {
        long lv = skilllv + 1;
        return (lv * lv);
    }
    //获取技能描述配置
    public static ConfigSkillDesc GetSkillLevelDesc(int skilllv)
    {
        int lv = skilllv / 10;
        lv = Math.Max(lv, Conf.ConfSkillDesc.Keys.Min());
        lv = Math.Min(lv, Conf.ConfSkillDesc.Keys.Max());
        return Conf.ConfSkillDesc[lv];
    }
}
